import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//实现@等于./src --绝对路径
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 7070,
    // proxy: {
    //   'api': {
    //     target: "http://localhost:8080",
    //     changeOrigin: true
    //   }
    // }
  },
  resolve: {
    alias: [
      {
        find: '@',
        replacement: resolve(__dirname, './src')
      },
      {
        find: 'avatar',
        replacement: resolve(__dirname, './src/assets/avatars')
      }
    ]
  }
})
